<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>js生成二维码</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #box{
            display: inline-block;
            font-size: 0;
        }
    </style>
</head>
<body>
<div id="box"></div>
<script src="./qrcodelogo.js"></script>
<script>
    /*
    * @ text:       需要转换成二维码的数据
    * @ width:      宽
    * @ height      高
    * @ colorDark   二维码颜色
    * @ colorLight  背景颜色
    * @ correctLevel 容错级别，默认为 QRCode.CorrectLevel.H
    *       QRCode.CorrectLevel.M 0
    *       QRCode.CorrectLevel.L 1
    *       QRCode.CorrectLevel.H 2
    *       QRCode.CorrectLevel.Q 3
    * @ imgWidth    logo的宽
    * @ imgHeight   logo的高
    * @ imgSrc      logo图片地址
    * */

    var eBox = document.getElementById('box')

    var qrcode = new QRCode(eBox, {
        text: 'https://www.baidu.com/',
        width: 300,
        height: 300,
        colorDark : '#000000',
        colorLight : '#eeeeee',
        correctLevel : QRCode.CorrectLevel.H,
        imgWidth: 70,
        imgHeight: 70,
        // imgSrc: 'https://blcyzycc.gitee.io/lutu/logo.png'
        imgSrc: './logo.png'
    });

</script>
</body>
</html>